package cn.edu.zzuli.nothinglink.controller;


import cn.edu.zzuli.nothinglink.anno.CurrentUser;
import cn.edu.zzuli.nothinglink.entity.R;
import cn.edu.zzuli.nothinglink.service.LiveRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-08
 */
@RestController
@RequestMapping("/live-record")
public class LiveRecordController {

    @Autowired
    LiveRecordService liveRecordService;

    @GetMapping("/my")
    public R getMyLiveRecords(@CurrentUser Integer teaId) {
        if (teaId == null) return R.error().add("error", "请先登陆");
        return liveRecordService.getLiveRecordsById(teaId);
    }

}

